xen/arm: cmpxchg: Add missing memory barriers in __cmpxchg_mb_timeout()
authorJulien Grall <jgrall@amazon.com>
Wed, 29 Jul 2020 13:50:37 +0000 (14:50 +0100)
committerStefano Stabellini <sstabellini@kernel.org>
Tue, 15 Sep 2020 00:20:52 +0000 (17:20 -0700)
commit28855ebcdbfa437e60bc16c761405476fe16bc39
tree651f5831d8a0d9fef9859d3ec21edc56505bf7ca
parent174be04403be87eaa217c47a59665fc5fe317c05
xen/arm: cmpxchg: Add missing memory barriers in __cmpxchg_mb_timeout()

The function __cmpxchg_mb_timeout() was intended to have the same
semantics as __cmpxchg_mb(). Unfortunately, the memory barriers were
not added when first implemented.

There is no known issue with the existing callers, but the barriers are
added given this is the expected semantics in Xen.

The issue was introduced by XSA-295.

Backport: 4.8+
Fixes: 86b0bc958373 ("xen/arm: cmpxchg: Provide a new helper that can timeout")
Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
(cherry picked from commit d501ef90ae7f2a79130ea89acb3d6d1792972934)
xen/include/asm-arm/arm32/cmpxchg.h
xen/include/asm-arm/arm64/cmpxchg.h